#ifndef PAINTMAUVEIMAGETHREAD_H
#define PAINTMAUVEIMAGETHREAD_H

#include <QThread>
#include <QImage>
#include <QPainter>
#include "mauvedata.h"
#include <QDebug>
#include "imagedata.h"



class PaintMauveImageThread : public QThread
{
    Q_OBJECT
public:
    explicit PaintMauveImageThread(MauveData md, WinData wd, TransformData td,QObject *parent = 0);
    ~PaintMauveImageThread();
signals:
    void createMauveImageDone(ImageData ida);

public slots:

private:
    MauveData paintThreadMauveData;
    WinData paintThreadWinData;
    TransformData paintThreadTransformData;

    void run();

    QVector<qreal> blockStartCoordinationX;
    QVector<qreal> blockEndCoordinationX;
    QVector<qreal> genomeStartCoordinationY;
    QImage image;
    ImageData iData;
    qreal maximGenomeLengh;
    qint32 genomeNumber;
    QVector<QColor> colorCandidate;
    qreal genomeLength2ScreenLengthRate;
    QVector<qint32> genomeStartNa;
    //QVector<qint32> genomeEndNa;

    void initializeColorCandidate();
    void calculateCoordinations();
    void drawScale();
    void drawBlocks();
    qint32 calculateScaleMaxNA(qint32 originalMaxNA);

    static const qreal GenomeDistancePixel = 80;
    static const qreal DistanceBetweenGenomeAndScale = 20;
    static const qreal DistanceBetweenImageAndScreen = 5;
    static const qreal BlockHeight = 15;
    static const qreal ScaleLineLength = 5;
    //prefer consts,enums and inlines to #defines. --Scott Meyers

    //qreal CalculateScaleGap(qreal maximGenomeL);

};

#endif // PAINTMAUVEIMAGETHREAD_H
